package club.babyf.springai.controller;

import club.babyf.oss.service.OSSService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequiredArgsConstructor
@RequestMapping("/spring-ai/oss")
public class OSSController {

    private final OSSService ossService;

    @PostMapping("/upload")
    public String upload(@RequestParam("file") MultipartFile file) {
        return ossService.upload(file);
    }

}
